package net.lym.strategy.context;


import net.lym.entity.MerchandiseEntity;
import net.lym.entity.UserEntity;
import net.lym.enums.DiscountEnum;

import java.util.Map;

/**
 * 购物策略模式回调接口
 */
public interface ShoppingStrategyAware {

    /**
     * 返回应享折扣枚举
     *
     * @return 折扣
     */
    DiscountEnum getStrategy();

    /**
     * 购买
     *
     * @param user        用户
     * @param merchandise 商品
     * @return 结果
     */
    Map<String, Object> buy(UserEntity user, MerchandiseEntity merchandise);

}
